<?php

/**
 * 头条模型
 */

namespace app\api\model;

use PDOStatement;
use think\Collection;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\exception\DbException;
use think\Model;

class Notice extends Model {

    /**
     * 头条
     * @return array|PDOStatement|string|Collection
     * @throws DataNotFoundException
     * @throws ModelNotFoundException
     * @throws DbException
     */
    public function noticeList() {
        $data = $this->where('status', 1)->order('sort', 'asc')->select();
        for ($i = 0; $i < count($data); $i++) {
            $data[$i]['itime'] = detail_time($data[$i]['itime']);
        }
        return $data;
    }

}
